home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / csD Email 24194862001.psc / frmEmailAttachment.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-08-07  |  9.1 KB  |  299 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form frmEmailAttachment 
  4.    BackColor       =   &H00FFFFFF&
  5.    BorderStyle     =   3  'Fixed Dialog
  6.    ClientHeight    =   3945
  7.    ClientLeft      =   45
  8.    ClientTop       =   45
  9.    ClientWidth     =   4290
  10.    ControlBox      =   0   'False
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   3945
  15.    ScaleWidth      =   4290
  16.    ShowInTaskbar   =   0   'False
  17.    StartUpPosition =   3  'Windows Default
  18.    Begin MSComDlg.CommonDialog cmbFile 
  19.       Left            =   3000
  20.       Top             =   0
  21.       _ExtentX        =   847
  22.       _ExtentY        =   847
  23.       _Version        =   393216
  24.    End
  25.    Begin VB.ListBox lstAttach 
  26.       BackColor       =   &H00FFC0C0&
  27.       Height          =   1035
  28.       Left            =   240
  29.       TabIndex        =   7
  30.       Top             =   1320
  31.       Width           =   3855
  32.    End
  33.    Begin VB.ListBox lstPath 
  34.       Height          =   1035
  35.       Left            =   240
  36.       TabIndex        =   9
  37.       Top             =   2400
  38.       Width           =   3855
  39.    End
  40.    Begin VB.TextBox txtFilename 
  41.       BackColor       =   &H00FFC0C0&
  42.       Height          =   285
  43.       Left            =   240
  44.       TabIndex        =   5
  45.       Top             =   600
  46.       Width           =   3495
  47.    End
  48.    Begin VB.Label cmdBrowse 
  49.       Alignment       =   2  'Center
  50.       Appearance      =   0  'Flat
  51.       BackColor       =   &H00FF8080&
  52.       BorderStyle     =   1  'Fixed Single
  53.       Caption         =   "..."
  54.       BeginProperty Font 
  55.          Name            =   "MS Serif"
  56.          Size            =   6
  57.          Charset         =   0
  58.          Weight          =   700
  59.          Underline       =   0   'False
  60.          Italic          =   0   'False
  61.          Strikethrough   =   0   'False
  62.       EndProperty
  63.       ForeColor       =   &H80000008&
  64.       Height          =   255
  65.       Left            =   3840
  66.       TabIndex        =   10
  67.       Top             =   600
  68.       Width           =   255
  69.    End
  70.    Begin VB.Label cmdOK 
  71.       Alignment       =   2  'Center
  72.       Appearance      =   0  'Flat
  73.       BackColor       =   &H00FF8080&
  74.       BorderStyle     =   1  'Fixed Single
  75.       Caption         =   "OK"
  76.       BeginProperty Font 
  77.          Name            =   "MS Serif"
  78.          Size            =   6
  79.          Charset         =   0
  80.          Weight          =   700
  81.          Underline       =   0   'False
  82.          Italic          =   0   'False
  83.          Strikethrough   =   0   'False
  84.       EndProperty
  85.       ForeColor       =   &H80000008&
  86.       Height          =   255
  87.       Left            =   3000
  88.       TabIndex        =   8
  89.       Top             =   3480
  90.       Width           =   855
  91.    End
  92.    Begin VB.Label lblList 
  93.       Appearance      =   0  'Flat
  94.       BackColor       =   &H80000005&
  95.       BackStyle       =   0  'Transparent
  96.       Caption         =   "Attached Files :"
  97.       ForeColor       =   &H0000FF00&
  98.       Height          =   255
  99.       Left            =   240
  100.       TabIndex        =   6
  101.       Top             =   1080
  102.       Width           =   1215
  103.    End
  104.    Begin VB.Label Label4 
  105.       Appearance      =   0  'Flat
  106.       BackColor       =   &H80000005&
  107.       BackStyle       =   0  'Transparent
  108.       Caption         =   "Filename :"
  109.       ForeColor       =   &H0000FF00&
  110.       Height          =   255
  111.       Left            =   240
  112.       TabIndex        =   4
  113.       Top             =   360
  114.       Width           =   1095
  115.    End
  116.    Begin VB.Label cmdReset 
  117.       Alignment       =   2  'Center
  118.       Appearance      =   0  'Flat
  119.       BackColor       =   &H00FF8080&
  120.       BorderStyle     =   1  'Fixed Single
  121.       Caption         =   "Reset"
  122.       BeginProperty Font 
  123.          Name            =   "MS Serif"
  124.          Size            =   6
  125.          Charset         =   0
  126.          Weight          =   700
  127.          Underline       =   0   'False
  128.          Italic          =   0   'False
  129.          Strikethrough   =   0   'False
  130.       EndProperty
  131.       ForeColor       =   &H80000008&
  132.       Height          =   255
  133.       Left            =   2160
  134.       TabIndex        =   3
  135.       Top             =   3480
  136.       Width           =   855
  137.    End
  138.    Begin VB.Label cmdRemoveFile 
  139.       Alignment       =   2  'Center
  140.       Appearance      =   0  'Flat
  141.       BackColor       =   &H00FF8080&
  142.       BorderStyle     =   1  'Fixed Single
  143.       Caption         =   "Remove File"
  144.       BeginProperty Font 
  145.          Name            =   "MS Serif"
  146.          Size            =   6
  147.          Charset         =   0
  148.          Weight          =   700
  149.          Underline       =   0   'False
  150.          Italic          =   0   'False
  151.          Strikethrough   =   0   'False
  152.       EndProperty
  153.       ForeColor       =   &H80000008&
  154.       Height          =   255
  155.       Left            =   1320
  156.       TabIndex        =   2
  157.       Top             =   3480
  158.       Width           =   855
  159.    End
  160.    Begin VB.Image imgClose 
  161.       Height          =   210
  162.       Left            =   3960
  163.       Picture         =   "frmEmailAttachment.frx":0000
  164.       Top             =   0
  165.       Width           =   225
  166.    End
  167.    Begin VB.Label Label3 
  168.       BackStyle       =   0  'Transparent
  169.       Caption         =   "Email Attachments"
  170.       BeginProperty Font 
  171.          Name            =   "MS Serif"
  172.          Size            =   6.75
  173.          Charset         =   0
  174.          Weight          =   400
  175.          Underline       =   0   'False
  176.          Italic          =   0   'False
  177.          Strikethrough   =   0   'False
  178.       EndProperty
  179.       ForeColor       =   &H00FFFF00&
  180.       Height          =   255
  181.       Left            =   1320
  182.       TabIndex        =   1
  183.       Top             =   0
  184.       Width           =   1215
  185.    End
  186.    Begin VB.Label cmdAddFile 
  187.       Alignment       =   2  'Center
  188.       Appearance      =   0  'Flat
  189.       BackColor       =   &H00FF8080&
  190.       BorderStyle     =   1  'Fixed Single
  191.       Caption         =   "Add File"
  192.       BeginProperty Font 
  193.          Name            =   "MS Serif"
  194.          Size            =   6
  195.          Charset         =   0
  196.          Weight          =   700
  197.          Underline       =   0   'False
  198.          Italic          =   0   'False
  199.          Strikethrough   =   0   'False
  200.       EndProperty
  201.       ForeColor       =   &H80000008&
  202.       Height          =   255
  203.       Left            =   480
  204.       TabIndex        =   0
  205.       Top             =   3480
  206.       Width           =   855
  207.    End
  208.    Begin VB.Image imgMinimize 
  209.       Height          =   210
  210.       Left            =   3720
  211.       Picture         =   "frmEmailAttachment.frx":0352
  212.       Top             =   0
  213.       Width           =   240
  214.    End
  215.    Begin VB.Image Image1 
  216.       Height          =   4095
  217.       Left            =   0
  218.       Picture         =   "frmEmailAttachment.frx":0677
  219.       Stretch         =   -1  'True
  220.       Top             =   0
  221.       Width           =   4335
  222.    End
  223. Attribute VB_Name = "frmEmailAttachment"
  224. Attribute VB_GlobalNameSpace = False
  225. Attribute VB_Creatable = False
  226. Attribute VB_PredeclaredId = True
  227. Attribute VB_Exposed = False
  228. Option Explicit
  229. Dim NumOfFilesAttached As Integer
  230. Private Sub cmdAddFile_Click()
  231. Dim strFileTitle As String
  232. Dim strFilePath As String
  233. Dim strTemp As String
  234. Dim nPos As Integer
  235. Dim NoMoreSlash As String
  236. strFilePath = Trim$(txtFilename.Text) 'Remove spaces
  237. 'Check the availabality
  238. If Dir(strFilePath) = "" Then
  239.  csMsgbox "File can not be found.Please check the path", "File not found", "CSOKONLY"
  240.  Exit Sub
  241. End If
  242. strTemp = strFilePath
  243. 'Remove Path
  244. nPos = InStr(1, strTemp, "\")
  245. If nPos Then
  246.  strTemp = Mid$(strTemp, nPos + 1)
  247.  Exit Do
  248. End If
  249. DoEvents
  250. strFileTitle = strTemp
  251. 'Add entry to the list.
  252. NumOfFilesAttached = NumOfFilesAttached + 1
  253. lstPath.AddItem txtFilename.Text
  254. lstAttach.AddItem strFileTitle & " (" & FileLen(strFilePath) & " bytes )"
  255. End Sub
  256. Private Sub cmdBrowse_Click()
  257. 'Show up the dialog
  258. cmbFile.Filter = "All Files ( *.* )|*.*"
  259. cmbFile.ShowOpen
  260. 'Check if user press cancel.
  261. If cmbFile.CancelError Then
  262.  Exit Sub
  263. End If
  264. 'Assign the path to the textbox
  265. txtFilename.Text = cmbFile.FileName
  266. End Sub
  267. Private Sub cmdOK_Click()
  268. Dim I As Integer
  269. 'Check if there is any file to be attached,otherwise unload the form
  270. If NumOfFilesAttached = 0 Then
  271.  AttachedFiles = False
  272.  Me.Hide
  273. End If
  274. 'Add the files path to array.
  275. 'ReDim Preserve FileAttached(NumOfFilesAttached)
  276. For I = 1 To NumOfFilesAttached
  277.  FileAttached(I) = lstPath.List(I)
  278. Next I
  279. MsgBox FileAttached(1)
  280. 'Unload the form.
  281. AttachedFiles = True
  282. frmSMTP.SetFocus
  283. Me.Hide
  284. End Sub
  285. Private Sub cmdRemoveFile_Click()
  286. lstPath.RemoveItem lstAttach.ListIndex
  287. lstAttach.RemoveItem lstAttach.ListIndex
  288. NumOfFilesAttached = NumOfFilesAttached - 1
  289. End Sub
  290. Private Sub cmdReset_Click()
  291. 'Clear listboxes.
  292. lstPath.Clear
  293. lstAttach.Clear
  294. NumOfFilesAttached = 0
  295. End Sub
  296. Private Sub Form_Load()
  297. lstPath.AddItem "Empty"
  298. End Sub
  299.